
<#include "/includes/son.ftl">

        <script type="text/javascript">

            $(function () {
                $("#doeditPasswd").click(function () {

                    var adminPass = $("#adminPass").val();
                    var newpwd = $("#newpwd").val();
                    var confirmpwd = $("#confirmpwd").val();
                    var id=document.getElementById("id").value;

                    if (adminPass.length < 1 || newpwd.length < 1 || confirmpwd.length < 1) {

                        alert("输入不能为空！");
                        return false;
                    }

                    if(!(newpwd==confirmpwd)){
                        alert("两次密码输入不一致！");
                        document.getElementById("adminPass").value = "";
                        document.getElementById("newpwd").value = "";
                        document.getElementById("confirmpwd").value = "";
                        return false;
                    }

                    $.post("/admin/shopAdmin/editPasswd",
                        {adminPass: adminPass, newpwd: newpwd, id: id},
                        function(data){
                            if(data.status==200){
                             lightyear.notify(data.data, 'success', 100);
                             window.location.href = "/admin/shopAdmin/doLogout";

                            }else{
                                lightyear.notify(data.data, 'danger', 100);
                            }
                        })
                });
            });
        </script>

    <div class="container-fluid" style="margin-top: 15px;">
    <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-body">

                            <div class="form-group">
                                <input type="hidden" value="${Session["adminId"]}" id="id">

                                <label for="old-password">旧密码</label>
                                <input type="password" class="form-control" name="adminPass" id="adminPass" placeholder="输入账号的原登录密码" >
                            </div>
                            <div class="form-group">
                                <label for="new-password">新密码</label>
                                <input type="password" class="form-control" name="newpwd" id="newpwd" placeholder="输入新的密码" >
                            </div>
                            <div class="form-group">
                                <label for="confirm-password">确认新密码</label>
                                <input type="password" class="form-control" name="confirmpwd" id="confirmpwd" placeholder="请输入再次新的密码" >
                            </div>
                            <input id="doeditPasswd" type="button" class="btn btn-primary" value="修改密码"></input>

                    </div>
                </div>
            </div>

        </div>

    </div>

